﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
using System.Text.RegularExpressions;
using ApiDoc.CodeSyntaxGenerators;

namespace ApiDoc
{
    partial class ApiDocumentationManager
    {
        /// <summary>
        /// Gets and Sets the language to use for syntaxes.
        /// </summary>
        /// <remarks>
        /// Property is initialised to C# when the class is contructed.
        /// </remarks>
        public string CodeSyntaxLanguage
        {
            get { return m_codeSyntaxLanguage; }
            set
            {
                if (m_codeSyntaxLanguage == value) {
                    return;
                }

                m_codeSyntaxLanguage = value;

                CodeSyntaxGenerator = CodeSyntaxGeneratorFactory.Default.CreateGenerator(m_codeSyntaxLanguage);
            }
        }

        /// <summary>
        /// Returns the languages supported by the code syntax and available for CodeSyntaxLanguage.
        /// </summary>
        /// <remarks>
        /// This is a convience wrapper that makes a direct call to CodeSyntaxGeneratorFactory.Default.GetSupportedLanguages()
        /// </remarks>
        /// <returns></returns>
        public static IEnumerable<string> GetSupportedLanguages()
        {
            return CodeSyntaxGeneratorFactory.Default.GetSupportedLanguages();
        }

        private string m_codeSyntaxLanguage;

        /// <summary>
        /// Gets the generator that is being used to generate code language specific parts of the documentation.
        /// </summary>
        public ICodeSyntaxGenerator CodeSyntaxGenerator { get; protected set; }
        

    }
}
